/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.gemom.auction;

/**
 *
 * @author Yair Diaz
 */
import java.util.*;
import com.gemom.*;


public class Test{
	
	public static void main(String[]args){
	int numberbids=100;
        //for bidgenerator i have to use more than 6 items otherwise it gets stuck...why? lol
	int numberitems=28;
	double avgprice = 5;	

	Vector<Bid> listBids=null;	

	BidGenerator bg = new BidGenerator();
	listBids = bg.getListBidsGen(numberitems,numberbids,avgprice);
        
        
        for(int i=0;i<listBids.size();i++)
            System.out.println(listBids.get(i));
        
		
////////////////////////////////////////////////////////
 /*       
        Item[] arrayItems= new Item[numberitems];
        for(int i=0;i<arrayItems.length;i++)
                arrayItems[i] = new Item(i,0.0,0.0);//itemrate zero for now
 
     //Generating the bids		
        listBids = new Vector<Bid>();
	for(int i=0;i<numberbids;i++)listBids.add(new Bid(i));   
        
        listBids.get(0).addItem(arrayItems[0],arrayItems[2],arrayItems[4]);
	listBids.get(0).price=13.0;
	listBids.get(1).addItem(arrayItems[0],arrayItems[1]);
	listBids.get(1).price=9.0;
	listBids.get(2).addItem(arrayItems[0],arrayItems[3]);
	listBids.get(2).price=10.0;
        listBids.get(3).addItem(arrayItems[1],arrayItems[4]);
	listBids.get(3).price=7.0;
        listBids.get(4).addItem(arrayItems[2],arrayItems[4]);
	listBids.get(4).price=12.0;
	listBids.get(5).addItem(arrayItems[0]);//dummy bid
	listBids.get(5).price=4.0;
	listBids.get(6).addItem(arrayItems[1]);//dummy bid
	listBids.get(6).price=5.0;
	listBids.get(7).addItem(arrayItems[2]);//dummy bid
	listBids.get(7).price=3.0;
	listBids.get(8).addItem(arrayItems[3]);//dummy bid
	listBids.get(8).price=5.0;
	listBids.get(9).addItem(arrayItems[4]);//dummy bid
	listBids.get(9).price=4.0;

    */
 
	System.out.println(new Date());	
	searchTree tree = new searchTree(listBids);
        System.out.println("The winner path is:Exhaustive");
	for(int i=0;i<tree.getWinnerPath().size();i++)
		System.out.println(tree.getWinnerPath().get(i));
	System.out.println("The max path value is: "+tree.getTotalWinnerPath());
        System.out.println("Number of nodes explored: "+tree.getNodesExplored());
        
        
        
        
	System.out.println(new Date());
	System.out.println("\n");
	System.out.println(new Date());	
	searchTree2 tree2 = new searchTree2(listBids,0.95);
         
        System.out.println("The winner path is:Astar");
	for(int i=0;i<tree2.getWinnerPath().size();i++)
		System.out.println(tree2.getWinnerPath().get(i));
	System.out.println("The max path value is: "+tree2.getTotalWinnerPath());
        System.out.println("Number of nodes explored: "+tree2.getNodesExplored());
        System.out.println(new Date());	
	
        }
}

